cmake_minimum_required(VERSION 2.8)
set(EXE_NAME LQShm)
set(LIB_SHARED_NAME LQShm_shared)
set(LIB_STATIC_NAME LQShm_static)

add_compile_options(-std=c99 -Wall)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

if (DEBUG)
    add_definitions(-DDEBUG)
endif ()

if (LOG)
    add_definitions(-DLOG)
endif ()

set(SRC main.c LinkQueue.c sighandler.c)

if (LIB)
    add_library(${LIB_SHARED_NAME} SHARED ${SRC})
    add_library(${LIB_STATIC_NAME} STATIC ${SRC})
else ()
    add_executable(${EXE_NAME} ${SRC})
endif ()